//
//  UICGDirectionsService.h
//  MapDirectionsV3
//
//  Created by Kishikawa Katsumi on 09/12/19.
//  Copyright Kishikawa Katsumi 2009. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "UICGDirectionsOptions.h"
#import "UICGoogleMapsAPI.h"

@interface UICGDirectionsService : NSObject<UICGoogleMapsAPIDelegate> {
	id delegate;
	UICGoogleMapsAPI *googleMapsAPI;
	NSArray *legs;
	NSArray *polylines;
    BOOL isInitialized;
}

@property (nonatomic, assign) id delegate;
@property (nonatomic, retain) NSArray *legs;
@property (nonatomic, retain) NSArray *polylines;
@property (nonatomic, readonly) BOOL isInitialized;

+ (UICGDirectionsService *)sharedDirectionsService;
- (void)routeWithStartPoint:(NSString *)startPoint endPoint:(NSString *)endPoint options:(UICGDirectionsOptions *)options;
- (void)routeFromWaypoints:(NSArray *)waypoints options:(UICGDirectionsOptions *)options;
- (NSInteger)numberOfRoutes;
- (id)routeAtIndex:(NSInteger)index;

@end

@protocol UICGDirectionsDelegate
@optional
- (void)directionsServiceDidFinishInitialize:(UICGDirectionsService *)directionsService;
- (void)directionsService:(UICGDirectionsService *)directionsService didFailInitializeWithError:(NSError *)error;
- (void)directionsServiceDidUpdateDirections:(UICGDirectionsService *)directionsService;
- (void)directionsService:(UICGDirectionsService *)directionsService didFailWithMessage:(NSString *)message;
@end
